#include <cstdio>
#include <algorithm>
#include <map>
#include <vector>
using namespace std;
int n,m;
const int MAXN=200020;
long long presum[MAXN];
long long b;
int main(void){
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++){
        scanf("%lld",&b);
        presum[i]=presum[i-1]+b;
    }
    while(m--){
        scanf("%lld",&b);
        int idx=lower_bound(presum,presum+n,b)-presum;
        printf("%d %lld\n",idx,b-presum[idx-1]);
    }
    return 0;
}
